package com.moonshineproject.plugin.actionscript.as3parser.vo
{
	import __AS3__.vec.Vector;
	
	import flash.utils.IExternalizable;
	
	[RemoteClass(alias="v1.FunctionVO")]
	public class FunctionVO extends MemberBase
	{
		public var parameters:Vector.<ParameterVO> =new Vector.<ParameterVO>();
		
		override public function toString():String
		{
			var params:String = "";
			if (parameters)
			{
				var lastParam:ParameterVO;
				for each (var param:ParameterVO in parameters)
				{
					var typeEntry:String = param.name;
					if (param.type)
					{
						typeEntry += ":" + param.type;
					}
					if (lastParam) params += ",";
					params += typeEntry;
					
					lastParam = param;
				}
			}
			
			var returnType:String = "";
			if (type)
			{
				returnType += ":" + type;
			}
			
			return name + "(" + params + ")" + returnType;
		}
	}
}